import requests
from bs4 import BeautifulSoup


def getinfom(url_info):
    url = url_info
    res = requests.get(url)
    page = BeautifulSoup(res.text, "html.parser")
    table = page.find("table", attrs={"id": "NeuronInfotable12"})
    trs = table.find_all("tr")
    with open("nue1.txt", "a+", encoding="utf-8") as f:
        for tr in trs[0:6]:
            td = tr.find_all("td")
            lst = [td[0].text, td[1].text]
            f.writelines(lst)
            f.write("\t")
        f.write('\n')
        res.close()

# getinfom('http://neuromorpho.org/neuron_info.jsp?neuron_name=Stack-6_stitched-ims')
